extension TimeX on DateTime {
  /// 用于生成适合后端的 String DateTime，例如：`2023-01-01 00:00:00`
  String get toStr {
    final monthStr = month.toString().padLeft(2, '0');
    final dayStr = day.toString().padLeft(2, '0');
    final hourStr = hour.toString().padLeft(2, '0');
    final minuteStr = minute.toString().padLeft(2, '0');
    final secondStr = second.toString().padLeft(2, '0');
    return '$year-$monthStr-$dayStr $hourStr:$minuteStr:$secondStr';
  }
}